home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / JFileChooser.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  15.8 KB  |  707 lines

  1. package javax.swing;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Frame;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9. import java.io.File;
  10. import java.io.IOException;
  11. import java.io.ObjectOutputStream;
  12. import java.util.Vector;
  13. import javax.accessibility.Accessible;
  14. import javax.accessibility.AccessibleContext;
  15. import javax.swing.filechooser.FileFilter;
  16. import javax.swing.filechooser.FileSystemView;
  17. import javax.swing.filechooser.FileView;
  18. import javax.swing.plaf.FileChooserUI;
  19.  
  20. public class JFileChooser extends JComponent implements Accessible {
  21.    private static final String uiClassID = "FileChooserUI";
  22.    public static final int OPEN_DIALOG = 0;
  23.    public static final int SAVE_DIALOG = 1;
  24.    public static final int CUSTOM_DIALOG = 2;
  25.    public static final int CANCEL_OPTION = 1;
  26.    public static final int APPROVE_OPTION = 0;
  27.    public static final int ERROR_OPTION = -1;
  28.    public static final int FILES_ONLY = 0;
  29.    public static final int DIRECTORIES_ONLY = 1;
  30.    public static final int FILES_AND_DIRECTORIES = 2;
  31.    public static final String CANCEL_SELECTION = "CancelSelection";
  32.    public static final String APPROVE_SELECTION = "ApproveSelection";
  33.    public static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY = "ApproveButtonTextChangedProperty";
  34.    public static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY = "ApproveButtonToolTipTextChangedProperty";
  35.    public static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY = "ApproveButtonMnemonicChangedProperty";
  36.    public static final String DIRECTORY_CHANGED_PROPERTY = "directoryChanged";
  37.    public static final String SELECTED_FILE_CHANGED_PROPERTY = "SelectedFileChangedProperty";
  38.    public static final String SELECTED_FILES_CHANGED_PROPERTY = "SelectedFilesChangedProperty";
  39.    public static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY = "fileFilterChanged";
  40.    public static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY = "FileSystemViewChanged";
  41.    public static final String FILE_VIEW_CHANGED_PROPERTY = "fileViewChanged";
  42.    public static final String FILE_HIDING_CHANGED_PROPERTY = "FileHidingChanged";
  43.    public static final String FILE_FILTER_CHANGED_PROPERTY = "fileFilterChanged";
  44.    public static final String FILE_SELECTION_MODE_CHANGED_PROPERTY = "fileSelectionChanged";
  45.    public static final String ACCESSORY_CHANGED_PROPERTY = "AccessoryChangedProperty";
  46.    private static final String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY = "AcceptAllFileFilterUsedChanged";
  47.    public static final String DIALOG_TITLE_CHANGED_PROPERTY = "DialogTitleChangedProperty";
  48.    public static final String DIALOG_TYPE_CHANGED_PROPERTY = "DialogTypeChangedProperty";
  49.    public static final String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY = "ChoosableFileFilterChangedProperty";
  50.    private String dialogTitle;
  51.    private String approveButtonText;
  52.    private String approveButtonToolTipText;
  53.    private int approveButtonMnemonic;
  54.    private ActionListener actionListener;
  55.    private Vector filters;
  56.    private JDialog dialog;
  57.    private int dialogType;
  58.    private int returnValue;
  59.    private JComponent accessory;
  60.    private FileView fileView;
  61.    private FileView uiFileView;
  62.    private boolean useFileHiding;
  63.    private int fileSelectionMode;
  64.    private boolean multiSelectionEnabled;
  65.    private boolean useAcceptAllFileFilter;
  66.    private FileFilter fileFilter;
  67.    private FileSystemView fileSystemView;
  68.    private File currentDirectory;
  69.    private File selectedFile;
  70.    private File[] selectedFiles;
  71.    protected AccessibleContext accessibleContext;
  72.    // $FF: synthetic field
  73.    static Class class$java$awt$Frame;
  74.    // $FF: synthetic field
  75.    static Class class$java$awt$event$ActionListener;
  76.  
  77.    public JFileChooser() {
  78.       this((File)null, (FileSystemView)null);
  79.    }
  80.  
  81.    public JFileChooser(File var1) {
  82.       this((File)var1, (FileSystemView)null);
  83.    }
  84.  
  85.    public JFileChooser(File var1, FileSystemView var2) {
  86.       this.dialogTitle = null;
  87.       this.approveButtonText = null;
  88.       this.approveButtonToolTipText = null;
  89.       this.approveButtonMnemonic = 0;
  90.       this.actionListener = null;
  91.       this.filters = new Vector(5);
  92.       this.dialog = null;
  93.       this.dialogType = 0;
  94.       this.returnValue = -1;
  95.       this.accessory = null;
  96.       this.fileView = null;
  97.       this.uiFileView = null;
  98.       this.useFileHiding = true;
  99.       this.fileSelectionMode = 0;
  100.       this.multiSelectionEnabled = false;
  101.       this.useAcceptAllFileFilter = true;
  102.       this.fileFilter = null;
  103.       this.fileSystemView = null;
  104.       this.currentDirectory = null;
  105.       this.selectedFile = null;
  106.       this.accessibleContext = null;
  107.       this.setup(var2);
  108.       this.setCurrentDirectory(var1);
  109.    }
  110.  
  111.    public JFileChooser(String var1) {
  112.       this((String)var1, (FileSystemView)null);
  113.    }
  114.  
  115.    public JFileChooser(String var1, FileSystemView var2) {
  116.       this.dialogTitle = null;
  117.       this.approveButtonText = null;
  118.       this.approveButtonToolTipText = null;
  119.       this.approveButtonMnemonic = 0;
  120.       this.actionListener = null;
  121.       this.filters = new Vector(5);
  122.       this.dialog = null;
  123.       this.dialogType = 0;
  124.       this.returnValue = -1;
  125.       this.accessory = null;
  126.       this.fileView = null;
  127.       this.uiFileView = null;
  128.       this.useFileHiding = true;
  129.       this.fileSelectionMode = 0;
  130.       this.multiSelectionEnabled = false;
  131.       this.useAcceptAllFileFilter = true;
  132.       this.fileFilter = null;
  133.       this.fileSystemView = null;
  134.       this.currentDirectory = null;
  135.       this.selectedFile = null;
  136.       this.accessibleContext = null;
  137.       this.setup(var2);
  138.       if (var1 == null) {
  139.          this.setCurrentDirectory((File)null);
  140.       } else {
  141.          this.setCurrentDirectory(this.fileSystemView.createFileObject(var1));
  142.       }
  143.  
  144.    }
  145.  
  146.    public JFileChooser(FileSystemView var1) {
  147.       this((File)null, var1);
  148.    }
  149.  
  150.    public boolean accept(File var1) {
  151.       boolean var2 = true;
  152.       if (this.fileFilter != null) {
  153.          var2 = this.fileFilter.accept(var1);
  154.       }
  155.  
  156.       return var2;
  157.    }
  158.  
  159.    public void addActionListener(ActionListener var1) {
  160.       super.listenerList.add(class$java$awt$event$ActionListener != null ? class$java$awt$event$ActionListener : (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")), var1);
  161.    }
  162.  
  163.    public void addChoosableFileFilter(FileFilter var1) {
  164.       if (var1 != null && !this.filters.contains(var1)) {
  165.          FileFilter[] var2 = this.getChoosableFileFilters();
  166.          this.filters.addElement(var1);
  167.          ((JComponent)this).firePropertyChange("ChoosableFileFilterChangedProperty", var2, this.getChoosableFileFilters());
  168.       }
  169.  
  170.       this.setFileFilter(var1);
  171.    }
  172.  
  173.    public void approveSelection() {
  174.       this.returnValue = 0;
  175.       if (this.dialog != null) {
  176.          this.dialog.setVisible(false);
  177.       }
  178.  
  179.       this.fireActionPerformed("ApproveSelection");
  180.    }
  181.  
  182.    public void cancelSelection() {
  183.       this.returnValue = 1;
  184.       if (this.dialog != null) {
  185.          this.dialog.setVisible(false);
  186.       }
  187.  
  188.       this.fireActionPerformed("CancelSelection");
  189.    }
  190.  
  191.    public void changeToParentDirectory() {
  192.       File var1 = this.getCurrentDirectory();
  193.       this.setCurrentDirectory(this.getFileSystemView().getParentDirectory(var1));
  194.    }
  195.  
  196.    // $FF: synthetic method
  197.    static Class class$(String var0) {
  198.       try {
  199.          return Class.forName(var0);
  200.       } catch (ClassNotFoundException var2) {
  201.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  202.       }
  203.    }
  204.  
  205.    public void ensureFileIsVisible(File var1) {
  206.       this.getUI().ensureFileIsVisible(this, var1);
  207.    }
  208.  
  209.    protected void fireActionPerformed(String var1) {
  210.       Object[] var2 = super.listenerList.getListenerList();
  211.       ActionEvent var3 = null;
  212.  
  213.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  214.          if (var2[var4] == (class$java$awt$event$ActionListener != null ? class$java$awt$event$ActionListener : (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")))) {
  215.             if (var3 == null) {
  216.                var3 = new ActionEvent(this, 1001, var1);
  217.             }
  218.  
  219.             ((ActionListener)var2[var4 + 1]).actionPerformed(var3);
  220.          }
  221.       }
  222.  
  223.    }
  224.  
  225.    public FileFilter getAcceptAllFileFilter() {
  226.       FileFilter var1 = null;
  227.       if (this.getUI() != null) {
  228.          var1 = this.getUI().getAcceptAllFileFilter(this);
  229.       }
  230.  
  231.       return var1;
  232.    }
  233.  
  234.    public AccessibleContext getAccessibleContext() {
  235.       if (this.accessibleContext == null) {
  236.          this.accessibleContext = new AccessibleJFileChooser(this);
  237.       }
  238.  
  239.       return this.accessibleContext;
  240.    }
  241.  
  242.    public JComponent getAccessory() {
  243.       return this.accessory;
  244.    }
  245.  
  246.    public int getApproveButtonMnemonic() {
  247.       return this.approveButtonMnemonic;
  248.    }
  249.  
  250.    public String getApproveButtonText() {
  251.       return this.approveButtonText;
  252.    }
  253.  
  254.    public String getApproveButtonToolTipText() {
  255.       return this.approveButtonToolTipText;
  256.    }
  257.  
  258.    public FileFilter[] getChoosableFileFilters() {
  259.       FileFilter[] var1 = new FileFilter[this.filters.size()];
  260.       this.filters.copyInto(var1);
  261.       return var1;
  262.    }
  263.  
  264.    public File getCurrentDirectory() {
  265.       return this.currentDirectory;
  266.    }
  267.  
  268.    public String getDescription(File var1) {
  269.       String var2 = null;
  270.       if (this.getFileView() != null) {
  271.          var2 = this.getFileView().getDescription(var1);
  272.       }
  273.  
  274.       if (var2 == null && this.uiFileView != null) {
  275.          var2 = this.uiFileView.getDescription(var1);
  276.       }
  277.  
  278.       return var2;
  279.    }
  280.  
  281.    public String getDialogTitle() {
  282.       return this.dialogTitle;
  283.    }
  284.  
  285.    public int getDialogType() {
  286.       return this.dialogType;
  287.    }
  288.  
  289.    public FileFilter getFileFilter() {
  290.       return this.fileFilter;
  291.    }
  292.  
  293.    public int getFileSelectionMode() {
  294.       return this.fileSelectionMode;
  295.    }
  296.  
  297.    public FileSystemView getFileSystemView() {
  298.       return this.fileSystemView;
  299.    }
  300.  
  301.    public FileView getFileView() {
  302.       return this.fileView;
  303.    }
  304.  
  305.    public Icon getIcon(File var1) {
  306.       Icon var2 = null;
  307.       if (this.getFileView() != null) {
  308.          var2 = this.getFileView().getIcon(var1);
  309.       }
  310.  
  311.       if (var2 == null && this.uiFileView != null) {
  312.          var2 = this.uiFileView.getIcon(var1);
  313.       }
  314.  
  315.       return var2;
  316.    }
  317.  
  318.    public String getName(File var1) {
  319.       String var2 = null;
  320.       if (this.getFileView() != null) {
  321.          var2 = this.getFileView().getName(var1);
  322.       }
  323.  
  324.       if (var2 == null && this.uiFileView != null) {
  325.          var2 = this.uiFileView.getName(var1);
  326.       }
  327.  
  328.       return var2;
  329.    }
  330.  
  331.    public File getSelectedFile() {
  332.       return this.selectedFile;
  333.    }
  334.  
  335.    public File[] getSelectedFiles() {
  336.       return this.selectedFiles == null ? new File[0] : (File[])this.selectedFiles.clone();
  337.    }
  338.  
  339.    public String getTypeDescription(File var1) {
  340.       String var2 = null;
  341.       if (this.getFileView() != null) {
  342.          var2 = this.getFileView().getTypeDescription(var1);
  343.       }
  344.  
  345.       if (var2 == null && this.uiFileView != null) {
  346.          var2 = this.uiFileView.getTypeDescription(var1);
  347.       }
  348.  
  349.       return var2;
  350.    }
  351.  
  352.    public FileChooserUI getUI() {
  353.       return (FileChooserUI)super.ui;
  354.    }
  355.  
  356.    public String getUIClassID() {
  357.       return "FileChooserUI";
  358.    }
  359.  
  360.    private boolean isAcceptAllFileFilterUsed() {
  361.       return this.useAcceptAllFileFilter;
  362.    }
  363.  
  364.    public boolean isDirectorySelectionEnabled() {
  365.       return this.fileSelectionMode == 1 || this.fileSelectionMode == 2;
  366.    }
  367.  
  368.    public boolean isFileHidingEnabled() {
  369.       return this.useFileHiding;
  370.    }
  371.  
  372.    public boolean isFileSelectionEnabled() {
  373.       return this.fileSelectionMode == 0 || this.fileSelectionMode == 2;
  374.    }
  375.  
  376.    public boolean isMultiSelectionEnabled() {
  377.       return this.multiSelectionEnabled;
  378.    }
  379.  
  380.    public boolean isTraversable(File var1) {
  381.       Boolean var2 = null;
  382.       if (this.getFileView() != null) {
  383.          var2 = this.getFileView().isTraversable(var1);
  384.       }
  385.  
  386.       if (var2 == null && this.uiFileView != null) {
  387.          var2 = this.uiFileView.isTraversable(var1);
  388.       }
  389.  
  390.       if (var2 == null && var1 != null) {
  391.          if (var1.isDirectory()) {
  392.             var2 = Boolean.TRUE;
  393.          } else {
  394.             var2 = Boolean.FALSE;
  395.          }
  396.       } else if (var2 == null) {
  397.          return false;
  398.       }
  399.  
  400.       return var2;
  401.    }
  402.  
  403.    protected String paramString() {
  404.       String var1 = this.approveButtonText != null ? this.approveButtonText : "";
  405.       String var2 = this.dialogTitle != null ? this.dialogTitle : "";
  406.       String var3;
  407.       if (this.dialogType == 0) {
  408.          var3 = "OPEN_DIALOG";
  409.       } else if (this.dialogType == 1) {
  410.          var3 = "SAVE_DIALOG";
  411.       } else if (this.dialogType == 2) {
  412.          var3 = "CUSTOM_DIALOG";
  413.       } else {
  414.          var3 = "";
  415.       }
  416.  
  417.       String var4;
  418.       if (this.returnValue == 1) {
  419.          var4 = "CANCEL_OPTION";
  420.       } else if (this.returnValue == 0) {
  421.          var4 = "APPROVE_OPTION";
  422.       } else if (this.returnValue == -1) {
  423.          var4 = "ERROR_OPTION";
  424.       } else {
  425.          var4 = "";
  426.       }
  427.  
  428.       String var5 = this.useFileHiding ? "true" : "false";
  429.       String var6;
  430.       if (this.fileSelectionMode == 0) {
  431.          var6 = "FILES_ONLY";
  432.       } else if (this.fileSelectionMode == 1) {
  433.          var6 = "DIRECTORIES_ONLY";
  434.       } else if (this.fileSelectionMode == 2) {
  435.          var6 = "FILES_AND_DIRECTORIES";
  436.       } else {
  437.          var6 = "";
  438.       }
  439.  
  440.       String var7 = this.currentDirectory != null ? this.currentDirectory.toString() : "";
  441.       String var8 = this.selectedFile != null ? this.selectedFile.toString() : "";
  442.       return super.paramString() + ",approveButtonText=" + var1 + ",currentDirectory=" + var7 + ",dialogTitle=" + var2 + ",dialogType=" + var3 + ",fileSelectionMode=" + var6 + ",returnValue=" + var4 + ",selectedFile=" + var8 + ",useFileHiding=" + var5;
  443.    }
  444.  
  445.    public void removeActionListener(ActionListener var1) {
  446.       super.listenerList.remove(class$java$awt$event$ActionListener != null ? class$java$awt$event$ActionListener : (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")), var1);
  447.    }
  448.  
  449.    public boolean removeChoosableFileFilter(FileFilter var1) {
  450.       if (this.filters.contains(var1)) {
  451.          if (this.getFileFilter() == var1) {
  452.             this.setFileFilter((FileFilter)null);
  453.          }
  454.  
  455.          FileFilter[] var2 = this.getChoosableFileFilters();
  456.          this.filters.removeElement(var1);
  457.          ((JComponent)this).firePropertyChange("ChoosableFileFilterChangedProperty", var2, this.getChoosableFileFilters());
  458.          return true;
  459.       } else {
  460.          return false;
  461.       }
  462.    }
  463.  
  464.    public void rescanCurrentDirectory() {
  465.       this.getUI().rescanCurrentDirectory(this);
  466.    }
  467.  
  468.    public void resetChoosableFileFilters() {
  469.       FileFilter[] var1 = this.getChoosableFileFilters();
  470.       this.setFileFilter((FileFilter)null);
  471.       this.filters.removeAllElements();
  472.       if (this.isAcceptAllFileFilterUsed()) {
  473.          this.addChoosableFileFilter(this.getAcceptAllFileFilter());
  474.       }
  475.  
  476.       ((JComponent)this).firePropertyChange("ChoosableFileFilterChangedProperty", var1, this.getChoosableFileFilters());
  477.    }
  478.  
  479.    private void setAcceptAllFileFilterUsed(boolean var1) {
  480.       boolean var2 = this.useAcceptAllFileFilter;
  481.       this.useAcceptAllFileFilter = var1;
  482.       if (!var1) {
  483.          this.removeChoosableFileFilter(this.getAcceptAllFileFilter());
  484.       } else {
  485.          this.removeChoosableFileFilter(this.getAcceptAllFileFilter());
  486.          this.addChoosableFileFilter(this.getAcceptAllFileFilter());
  487.       }
  488.  
  489.       ((JComponent)this).firePropertyChange("AcceptAllFileFilterUsedChanged", var2, this.useAcceptAllFileFilter);
  490.    }
  491.  
  492.    public void setAccessory(JComponent var1) {
  493.       JComponent var2 = this.accessory;
  494.       this.accessory = var1;
  495.       ((JComponent)this).firePropertyChange("AccessoryChangedProperty", var2, this.accessory);
  496.    }
  497.  
  498.    public void setApproveButtonMnemonic(char var1) {
  499.       int var2 = var1;
  500.       if (var1 >= 'a' && var1 <= 'z') {
  501.          var2 = var1 - 32;
  502.       }
  503.  
  504.       this.setApproveButtonMnemonic(var2);
  505.    }
  506.  
  507.    public void setApproveButtonMnemonic(int var1) {
  508.       if (this.approveButtonMnemonic != var1) {
  509.          int var2 = this.approveButtonMnemonic;
  510.          this.approveButtonMnemonic = var1;
  511.          ((JComponent)this).firePropertyChange("ApproveButtonMnemonicChangedProperty", var2, this.approveButtonMnemonic);
  512.       }
  513.    }
  514.  
  515.    public void setApproveButtonText(String var1) {
  516.       if (this.approveButtonText != var1) {
  517.          String var2 = this.approveButtonText;
  518.          this.approveButtonText = var1;
  519.          ((JComponent)this).firePropertyChange("ApproveButtonTextChangedProperty", var2, var1);
  520.       }
  521.    }
  522.  
  523.    public void setApproveButtonToolTipText(String var1) {
  524.       if (this.approveButtonToolTipText != var1) {
  525.          String var2 = this.approveButtonToolTipText;
  526.          this.approveButtonToolTipText = var1;
  527.          this.setDialogType(2);
  528.          ((JComponent)this).firePropertyChange("ApproveButtonToolTipTextChangedProperty", var2, this.approveButtonToolTipText);
  529.       }
  530.    }
  531.  
  532.    public void setCurrentDirectory(File var1) {
  533.       File var2 = this.currentDirectory;
  534.       if (var1 == null) {
  535.          this.currentDirectory = this.getFileSystemView().getHomeDirectory();
  536.          ((JComponent)this).firePropertyChange("directoryChanged", var2, this.currentDirectory);
  537.       } else if (this.currentDirectory == null || !this.currentDirectory.equals(var1)) {
  538.          for(File var3 = null; !this.isTraversable(var1) && var3 != var1 && !this.getFileSystemView().isRoot(var1); var1 = this.getFileSystemView().getParentDirectory(var1)) {
  539.             var3 = var1;
  540.          }
  541.  
  542.          this.currentDirectory = var1;
  543.          ((JComponent)this).firePropertyChange("directoryChanged", var2, this.currentDirectory);
  544.       }
  545.    }
  546.  
  547.    public void setDialogTitle(String var1) {
  548.       String var2 = this.dialogTitle;
  549.       this.dialogTitle = var1;
  550.       if (this.dialog != null) {
  551.          this.dialog.setTitle(var1);
  552.       }
  553.  
  554.       ((JComponent)this).firePropertyChange("DialogTitleChangedProperty", var2, var1);
  555.    }
  556.  
  557.    public void setDialogType(int var1) {
  558.       if (this.dialogType != var1) {
  559.          if (var1 != 0 && var1 != 1 && var1 != 2) {
  560.             throw new IllegalArgumentException("Incorrect Dialog Type: " + var1);
  561.          } else {
  562.             int var2 = this.dialogType;
  563.             this.dialogType = var1;
  564.             if (var1 == 0 || var1 == 1) {
  565.                this.setApproveButtonText((String)null);
  566.             }
  567.  
  568.             ((JComponent)this).firePropertyChange("DialogTypeChangedProperty", var2, var1);
  569.          }
  570.       }
  571.    }
  572.  
  573.    public void setFileFilter(FileFilter var1) {
  574.       FileFilter var2 = this.fileFilter;
  575.       this.fileFilter = var1;
  576.       if (this.selectedFile != null && this.fileFilter != null && !var1.accept(this.selectedFile)) {
  577.          this.setSelectedFile((File)null);
  578.       }
  579.  
  580.       ((JComponent)this).firePropertyChange("fileFilterChanged", var2, this.fileFilter);
  581.    }
  582.  
  583.    public void setFileHidingEnabled(boolean var1) {
  584.       boolean var2 = this.useFileHiding;
  585.       this.useFileHiding = var1;
  586.       ((JComponent)this).firePropertyChange("FileHidingChanged", var2, this.useFileHiding);
  587.    }
  588.  
  589.    public void setFileSelectionMode(int var1) {
  590.       if (this.fileSelectionMode != var1) {
  591.          int var2 = this.fileSelectionMode;
  592.          this.fileSelectionMode = var1;
  593.          ((JComponent)this).firePropertyChange("fileSelectionChanged", var2, this.fileSelectionMode);
  594.       }
  595.    }
  596.  
  597.    public void setFileSystemView(FileSystemView var1) {
  598.       FileSystemView var2 = this.fileSystemView;
  599.       this.fileSystemView = var1;
  600.       ((JComponent)this).firePropertyChange("FileSystemViewChanged", var2, this.fileSystemView);
  601.    }
  602.  
  603.    public void setFileView(FileView var1) {
  604.       FileView var2 = this.fileView;
  605.       this.fileView = var1;
  606.       ((JComponent)this).firePropertyChange("fileViewChanged", var2, var1);
  607.    }
  608.  
  609.    public void setMultiSelectionEnabled(boolean var1) {
  610.       if (this.multiSelectionEnabled != var1) {
  611.          boolean var2 = this.multiSelectionEnabled;
  612.          this.multiSelectionEnabled = var1;
  613.          ((JComponent)this).firePropertyChange("fileFilterChanged", var2, this.multiSelectionEnabled);
  614.       }
  615.    }
  616.  
  617.    public void setSelectedFile(File var1) {
  618.       File var2 = this.selectedFile;
  619.       this.selectedFile = var1;
  620.       if (this.selectedFile != null) {
  621.          String var3 = this.selectedFile.getParent();
  622.          if (var3 != null) {
  623.             File var4 = this.getFileSystemView().createFileObject(var3);
  624.             if (!var4.equals(this.getCurrentDirectory())) {
  625.                this.setCurrentDirectory(var4);
  626.             }
  627.          }
  628.  
  629.          this.ensureFileIsVisible(this.selectedFile);
  630.       }
  631.  
  632.       ((JComponent)this).firePropertyChange("SelectedFileChangedProperty", var2, this.selectedFile);
  633.    }
  634.  
  635.    public void setSelectedFiles(File[] var1) {
  636.       File[] var2 = this.selectedFiles;
  637.       this.selectedFiles = var1;
  638.       ((JComponent)this).firePropertyChange("SelectedFilesChangedProperty", var2, this.selectedFiles);
  639.    }
  640.  
  641.    protected void setup(FileSystemView var1) {
  642.       if (var1 == null) {
  643.          var1 = FileSystemView.getFileSystemView();
  644.       }
  645.  
  646.       this.setFileSystemView(var1);
  647.       this.updateUI();
  648.       if (this.isAcceptAllFileFilterUsed()) {
  649.          this.setFileFilter(this.getAcceptAllFileFilter());
  650.       }
  651.  
  652.    }
  653.  
  654.    public int showDialog(Component var1, String var2) {
  655.       if (var2 != null) {
  656.          this.setApproveButtonText(var2);
  657.          this.setDialogType(2);
  658.       }
  659.  
  660.       Frame var3 = var1 instanceof Frame ? (Frame)var1 : (Frame)SwingUtilities.getAncestorOfClass(class$java$awt$Frame != null ? class$java$awt$Frame : (class$java$awt$Frame = class$("java.awt.Frame")), var1);
  661.       Object var4 = null;
  662.       String var6;
  663.       if (this.getDialogTitle() != null) {
  664.          var6 = this.dialogTitle;
  665.       } else {
  666.          var6 = this.getUI().getDialogTitle(this);
  667.       }
  668.  
  669.       this.dialog = new JDialog(var3, var6, true);
  670.       Container var5 = this.dialog.getContentPane();
  671.       var5.setLayout(new BorderLayout());
  672.       var5.add(this, "Center");
  673.       this.dialog.pack();
  674.       this.dialog.setLocationRelativeTo(var1);
  675.       this.dialog.show();
  676.       return this.returnValue;
  677.    }
  678.  
  679.    public int showOpenDialog(Component var1) {
  680.       this.setDialogType(0);
  681.       return this.showDialog(var1, (String)null);
  682.    }
  683.  
  684.    public int showSaveDialog(Component var1) {
  685.       this.setDialogType(1);
  686.       return this.showDialog(var1, (String)null);
  687.    }
  688.  
  689.    public void updateUI() {
  690.       FileChooserUI var1 = (FileChooserUI)UIManager.getUI(this);
  691.       ((JComponent)this).setUI(var1);
  692.       this.uiFileView = this.getUI().getFileView(this);
  693.       if (this.isAcceptAllFileFilterUsed()) {
  694.          this.addChoosableFileFilter(this.getAcceptAllFileFilter());
  695.       }
  696.  
  697.    }
  698.  
  699.    private void writeObject(ObjectOutputStream var1) throws IOException {
  700.       var1.defaultWriteObject();
  701.       if (super.ui != null && this.getUIClassID().equals("FileChooserUI")) {
  702.          super.ui.installUI(this);
  703.       }
  704.  
  705.    }
  706. }
  707.